import request from '@/utils/request'
import type { LoginDTO, CaptchaResult, LoginResult } from '@/types/auth'

// 获取验证码
export function getCaptcha() {
  return request<CaptchaResult>({
    url: '/auth/login/code',
    method: 'get'
  })
}

// 登录
export function login(data: LoginDTO) {
  return request<LoginResult>({
    url: '/auth/login',
    method: 'post',
    data
  })
}

// 退出登录
export function logout() {
  return request<LoginResult>({
    url: '/auth/logout',
    method: 'get'
  })
} 